package com.lylg.picture_share.service.impl;

import com.lylg.picture_share.dao.UserMapper;
import com.lylg.picture_share.entity.User;
import com.lylg.picture_share.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public Integer addUser(User user) {
        return userMapper.addUser(user) ;
    }

    @Override
    public Integer deleteUser(Integer id) {
        return userMapper.deleteUser(id);
    }

    @Override
    public Integer updateUser(User user) {
        return userMapper.updateUser(user);
    }

    @Override
    public List<User> selectAllUser() {
        return userMapper.selectAllUser();
    }

    @Override
    public User selectUserById(Integer id) {
        return userMapper.selectUserById(id);
    }

    @Override
    public User getUserByNameAndPwd(User user) {
        return userMapper.selectUserByNameAndPwd(user);
    }
}
